package com.lb.base.constants;

import java.time.Duration;

/**
 * 常量
 * @author xiemingzhi
 * @since 1.0
 */
public class BaseConstants {

    private BaseConstants() {
    }

    public static final String PATH_PATTERN_ALL = "/**";
    public static final String JSON_FILE_SUFFIX = ".json";
    public static final String UTF8 = "UTF-8";

    public static final String MDC_KEY_TRACE_ID = "traceId";
    public static final String MILLIS_UNIT_SUFFIX = "ms";

    public static final Duration TEN_SEC = Duration.ofSeconds(10);
    public static final Duration ONE_MIN = Duration.ofMinutes(1);
    public static final Duration ONE_DAY = Duration.ofDays(1);
    public static final Duration ONE_WEEK = Duration.ofDays(7);

    public static final String REQUEST_HEADER_KEY_REQUEST_ID = "request-id";

    public static final String REQUEST_ATTRIBUTE_KEY_API_USER_ID = "userId";
    public static final String REQUEST_ATTRIBUTE_KEY_API_RIGHTS = "rights";
    public static final String REQUEST_ATTRIBUTE_KEY_API_NICKNAME = "nickname";
    public static final String REQUEST_ATTRIBUTE_KEY_API_VISIBLE_ID = "visibleId";
    public static final String REQUEST_ATTRIBUTE_KEY_API_LOG_REQUEST = "apiLogRequest";
    public static final String REQUEST_ATTRIBUTE_KEY_API_CURRENT_TIME_MILLIS = "currentTimeMillis";

    public static final String LOG_FORMAT_KEY_API_LOG_REQUEST = "Api-Request = {}";
    public static final String LOG_FORMAT_KEY_API_LOG_RESPONSE = "Api-Response = {}";
    public static final String LOG_FORMAT_KEY_JPUSH_LOG_REQUEST = "JPush-Request = {}";
    public static final String LOG_FORMAT_KEY_JPUSH_LOG_RESPONSE = "JPush-Response = {}";
    public static final String LOG_FORMAT_KEY_API_LOG_TIME_CONSUMING = "Api-Time-Consuming = {} ms";

    public static final String LOG_FORMAT_KEY_MYSQL_SYNC_REQUEST = "MysqlSync-Request = {}";
    public static final String LOG_FORMAT_KEY_MYSQL_SYNC_RESPONSE = "MysqlSync-Response = {}";

    //七牛云区域
    public static final String REGION_0 = "region0";
    public static final String REGION_1 = "region1";
    public static final String REGION_2 = "region2";

    //融云系统消息类型
    //文本消息
    public static final String RC_TXT_MSG = "RC:TxtMsg";
    //图片消息
    public static final String RC_IMG_MSG = "RC:ImgMsg";
    //语音消息
    public static final String RC_VC_MSG = "RC:RC:VcMsg";
    //图文消息
    public static final String RC_IMG_TEXT_MSG = "RC:ImgTextMsg";
    //文件消息
    public static final String RC_FILE_MSG = "RC:FileMsg";
    //位置消息
    public static final String RC_LBS_MSG = "RC:LBSMsg";

    //拍卖房倒计时上上限(单位分钟)
    public static final Integer AUCTION_COUNTDOWN_LIMIT = 1440;
}
